package src.resource;
import java.awt.Point;
import javax.swing.ImageIcon;
import javax.swing.JDialog;
import javax.swing.JOptionPane;

public class DialogResource {
	
	
	private final static String  PATH="InTouchClient/img/";
	//private static  Image imgError=Toolkit.getDefaultToolkit().getImage(PATH+"window-close.png");
	//private static Image imgInformation=Toolkit.getDefaultToolkit().getImage(PATH+"document-properties.png");
	//private static Image imgConfirmation=Toolkit.getDefaultToolkit().getImage(PATH+"dialog-apply.png");
	
	private static  ImageIcon imgError=new ImageIcon(PATH+"window-close.png");
	private static ImageIcon imgInformation=new ImageIcon(PATH+"document-properties.png");
	private static ImageIcon imgConfirmation=new ImageIcon(PATH+"dialog-apply.png");

	
	public  enum windowTypeEnum { wtError, wtInformation, wtConfirmation};
	
	public static void showSaveSucessfully(Point point){
		JOptionPane optionPane = new JOptionPane("User added sucessfully.");
	    JDialog dialog = optionPane.createDialog(null, "title");
	    dialog.setIconImage(null);
	    dialog.setLocation(point);
	    dialog.setVisible(true);


	}
	
	public static void showMessage(Point point,String title,String message,windowTypeEnum wt){
		ImageIcon img; 
		if(wt==windowTypeEnum.wtConfirmation)
			img=imgConfirmation;
		    else if(wt==windowTypeEnum.wtInformation)
		    	img=imgInformation;
		    else 
		    	img=imgError;
		
		JOptionPane optionPane = new JOptionPane(message,  JOptionPane.PLAIN_MESSAGE,JOptionPane.PLAIN_MESSAGE,img);
	    JDialog dialog = optionPane.createDialog(null, title);
	  
	    dialog.setLocation(point);
	    dialog.setVisible(true);
	}

}
